package com.du.annulrview;

import android.app.Activity;
import android.graphics.Color;
import android.os.Bundle;
import android.view.View;

import java.util.ArrayList;

public class AnnulrViewActivity extends Activity {
    private AnnulrView aView;
    private ArrayList<ProgressBean> progressList;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        progressList = new ArrayList<>();
        ProgressBean pb1 = new ProgressBean(40f , Color.RED);
        progressList.add(pb1);
        ProgressBean pb2 = new ProgressBean(80f , Color.GREEN);
        progressList.add(pb2);
        ProgressBean pb3 = new ProgressBean(90f , Color.BLUE);
        progressList.add(pb3);
        ProgressBean pb4 = new ProgressBean(60f , Color.MAGENTA);
        progressList.add(pb4);
        aView = findViewById(R.id.annulr);
        aView.setProgress(progressList);
    }


    public void click(View view) {
        progressList.clear();
        ProgressBean pb3 = new ProgressBean(60f , Color.MAGENTA);
        progressList.add(pb3);
        aView.setProgress(progressList);
    }
}
